<%@page import="backOffice.InfoCourse"%>
<%@page import="backOffice.JDBCCourseDAO"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>List of course</title>
</head>
<body>
	<center>
		<font color=red size=72>the Course：</font>
		<hr>
		<table border=1 bgColor="#ffffff" width="500px" height="100px">
			<tr>
				<td>Number</td>
				<td>Code</td>
				<td>Title</td>
				<td>Date Start</td>
				<td>Date End</td>
				<td>Location</td>
				<td><center>Action</center></td>
			</tr>
			<jsp:useBean id="con" class="backOffice.JDBCCourseDAO" />		
			<jsp:useBean id="infocourse" class="backOffice.InfoCourse" />
			<%
				java.util.Map<Integer, InfoCourse> list= con.getList();				
				for(Integer o : list.keySet())
				{						
			%>
			<tr>
				<td><%=o%></td>
				<td><%=list.get(o).getCode()%></td>
				<td><%=list.get(o).getTitle()%></td>
				<td><%=list.get(o).getDate_start()%></td>
				<td><%=list.get(o).getDate_end()%></td>
				<td><%=list.get(o).getLocation()%></td>
				<td><a href="DeleteServlet?id=<%=o%>">delete</a></td> 
			</tr>
			<%
				}
			%>
		</table>
		<a href="Insert.jsp">add</a> 
	</center>
</body>
</html>